package com.kucun.service.imp;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kucun.Dao.GoodsMapper;
import com.kucun.bean.Goods;
import com.kucun.bean.Page;
import com.kucun.service.GoodsService;

@Service
@Transactional 
public class GoodsServiceImp implements GoodsService {

	@Resource
	private GoodsMapper goodsMapper;
	public int save(Goods record) {
		return goodsMapper.insertSelective(record);
	}

	public boolean update(Goods record) {
		return goodsMapper.updateByPrimaryKey(record);
	}

	public boolean delete(String userid) {
		return goodsMapper.deleteByPrimaryKey(userid);
	}


	public Goods findById(int userid) {
		return goodsMapper.selectByPrimaryKey(userid);
	}


	public List<Goods> findAll(Page page){
          return (List<Goods>)goodsMapper.findAll(page);
	}
	public List<Goods> findAll(){
        return (List<Goods>)goodsMapper.findAll1();
	}
	public Page getCount(Page page) {
		
		return goodsMapper.getCount(page);
	}

	public int updateGoodsForDel(String ids) {
		return goodsMapper.updateGoodsForDel(ids);
	}

	public Integer updateByPrimaryKeySelective(Goods goods) {
		return goodsMapper.updateByPrimaryKeySelective(goods);
	}

	public List<Goods> GetGoodsExistOut(Page page) {
		return goodsMapper.GetGoodsExistOut(page);
	}

	public Page GetGoodsExistOutCount(Page page) {
		return goodsMapper.GetGoodsExistOutCount(page);
	}

}
